import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
import { dateTransformer } from '../../../../common/utils';

@Entity('child_info', {
  comment: '儿童信息表，存储孩子的基本信息和账号信息',
})
export class InfoEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'user_id', comment: 'user_id' })
  public userId: number;

  @Column({ type: 'int', name: 'parent_id', comment: '父母ID' })
  public parentId: number;

  @Column({ type: 'varchar', name: 'avatar', default: '', comment: 'avatar' })
  public avatar: string;

  @Column({ type: 'varchar', name: 'login_account', default: '', comment: '登录账号' })
  public loginAccount: string;

  @Column({ type: 'varchar', name: 'login_password', default: '', comment: '登录密码' })
  public loginPassword: string;

  @Column({ type: 'varchar', name: 'child_nickname', default: '', comment: '孩子昵称' })
  public childNickname: string;

  @Column({ type: 'varchar', name: 'child_gender', default: '', comment: '孩子性别' })
  public childGender: string;

  @Column({ type: 'text', name: 'personality', default: null, comment: '性格特点' })
  public personality: string;

  @Column({ type: 'text', name: 'hobbies', default: null, comment: '兴趣爱好' })
  public hobbies: string;

  @Column({ type: 'text', name: 'communication_appeal', default: null, comment: '交流诉求' })
  public communicationAppeal: string;

  @Column({ type: 'char', name: 'status', default: '1', length: 1, comment: '会员状态 0正常 1停用' })
  public status: string;

  @CreateDateColumn({ type: 'datetime', name: 'end_time', default: null, transformer: dateTransformer, comment: '结束时间' })
  public endTime: Date;

  @Column({ type: 'char', name: 'del_flag', default: false, comment: '删除标志' })
  public delFlag: string;

  @CreateDateColumn({ type: 'datetime', name: 'create_time', default: null, transformer: dateTransformer, comment: '创建时间' })
  public createTime: Date;

  @UpdateDateColumn({ type: 'datetime', name: 'update_time', default: null, transformer: dateTransformer, comment: '更新时间' })
  public updateTime: Date;
}
